const express = require('express');
const router = express.Router()
const pool = require('../utils/pool.js')

router.post('/consociation',(req,res,next)=>{
	// 获取post传递的参数
	var obj = req.body
	console.log(obj)
	// 执行SQL命令，将数据插入到数据表dept
	pool.query('insert into consociation set ?',[obj],(err,r)=>{
		if(err) {
			 return next()
		}
		console.log(r)
		// 插入数据不需要判断
		res.send({code: 200, msg: '添加成功'})
	})
})

module.exports = router
